﻿using UnityEngine;
using System.Collections;

public class PlayerCharacter : BaseCharacter
{
	public override void OnInitialize ()
	{
		base.OnInitialize ();

		GameScene.SetPlayerCharacter(this);			// 로딩되자마자 플레이어 캐릭터 세팅

		maxHP		+= CodexManager.clearCount;		// 클리어 카운트만큼 라이프 증가
		//maxHP		+= 100;//TEST
		curHP		= maxHP;
	}

	protected override void OnDie ()
	{
		base.OnDie ();

		GameScene.worldRoot.SendWorldEvent("OnCharDie");
	}

	public void Heal()
	{
		curHP++;
		if(curHP > maxHP)
		{
			curHP = maxHP;
		}
	}
}
